Release 10.1A: OpenEdge Development:
.NET Open Clients
Unknown value (?)
Unknown value (
?) is mapped to a null value for a .NET reference type (class); however, the .NET value types (System.Boolean,System.Decimal,System.Int32,System.Int64, andSystem.DateTime) always have a default value, and the null value does not belong to the set of values they support. For each of these value types, OpenEdge provides a holder class, which can be set to a null value, in theProgress.Open4GLnamespace. In ProxyGen, if you specify that one of these parameters can accept the Unknown value (?), the method is defined with the corresponding holder class; otherwise the parameter is defined using the .NET value type.This is an example of a C# proxy method signature that does not support Unknown value (
?) for the first and third parameters:
This is an example of a C# proxy method that allows all the parameter values to have Unknown value (
?):
Holder classes
For each Progress data type that maps to a .NET value type, there is a
Holderclass. TheseHolderclasses belong to theProgress.Open4GLnamespace and extend theProgress.Open4GL.Holderclass, shown in Table 4–3.
Table 4–4 shows 4GL-to-.NET value-type mappings for parameters that have a default mapping that cannot accept Unknown value (
?). These 4GL types are mapped to classes in theProgress.Open4GLnamespace, as shown in the table.
Setting an INPUT or INPUT/OUTPUT parameter to unknown
For
INPUTorINPUT-OUTPUTparameters, you can set an input value to the Unknown value (?) by settingValue=nullon the holder object.For example, in C#, to set the value of a holder object to unknown, use the
Valueproperty:
Testing an INPUT/OUTPUT or OUTPUT parameter for unknown
For
OUTPUTandINPUT-OUTPUTparameters, you can find out whether an unknown output value is returned by testing if theIsNullproperty is true or theValueproperty on the holder object equals null.For example, in C#, to test the value of a holder object, check the
isNULLorValueproperty:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |